package com.chenfan.mcn.model.vo;

import com.chenfan.mcn.enums.ArchivingStatusEnum;
import com.chenfan.mcn.enums.YearStatusEnum;
import com.chenfan.mcn.model.YearFrameContract;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;
import java.util.Objects;

/**
 * @Author liuyang
 * @Date 2021/1/19
 * @Time 18:34
 * @Version V1.0
 **/
@EqualsAndHashCode(callSuper = true)
@Data
public class YearFrameContractVO extends YearFrameContract {

    private String flowIds;

    private Long flowId;

    /**
     * 审批流节点名称
     */
    private String flowStatusName;

    /**
     * 合同主体名称
     */
    private String contractSubjectName;

    /**
     * 折扣返点审批单
     */
    DiscountInfoVO discountInfoVO;

    /**
     * 单据状态名称
     */
    private String yearStatusName;

    /**
     * 年框合同类型名称
     */
    private String contractTypeName;

    /**
     * 年框合同补充协议
     */
    List<YearSupplementaryAgreementVO> yearSupplementaryAgreementList;

    public String getYearStatusName() {
        if (Objects.nonNull(getYearStatus())) {
            return YearStatusEnum.getStatusName(getYearStatus());
        }
        return null;
    }

    /**
     * 归档状态名称
     */
    private String archivingStatusName;

    public String getArchivingStatusName() {
        if (Objects.nonNull(getArchivingStatus())) {
            return ArchivingStatusEnum.getStatusName(getArchivingStatus());
        }
        return null;
    }
}
